package androidx.appcompat.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.ActionMode.Callback;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import androidx.core.widget.TextViewCompat;
import o.ah.c;
import o.ca;
import o.cc;
import o.ct;
import o.hy;
import o.is;

public class AppCompatButton extends Button implements hy, is {
    private final ca ˋ;
    private final cc ˎ;

    public AppCompatButton(Context context) {
        this(context, null);
    }

    public AppCompatButton(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, c.ॱˎ);
    }

    public AppCompatButton(Context context, AttributeSet attributeSet, int i) {
        super(ct.ˋ(context), attributeSet, i);
        this.ˋ = new ca(this);
        this.ˋ.ˋ(attributeSet, i);
        this.ˎ = new cc(this);
        this.ˎ.ˏ(attributeSet, i);
        this.ˎ.ˊ();
    }

    public void setBackgroundResource(@DrawableRes int i) {
        super.setBackgroundResource(i);
        if (this.ˋ != null) {
            this.ˋ.ˎ(i);
        }
    }

    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        if (this.ˋ != null) {
            this.ˋ.ˋ(drawable);
        }
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
        if (this.ˋ != null) {
            this.ˋ.ˊ(colorStateList);
        }
    }

    @Nullable
    @RestrictTo({d.LIBRARY_GROUP})
    public ColorStateList ˊ() {
        return this.ˋ != null ? this.ˋ.ˎ() : null;
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public void setSupportBackgroundTintMode(@Nullable Mode mode) {
        if (this.ˋ != null) {
            this.ˋ.ॱ(mode);
        }
    }

    @Nullable
    @RestrictTo({d.LIBRARY_GROUP})
    public Mode ॱ() {
        return this.ˋ != null ? this.ˋ.ॱ() : null;
    }

    protected void drawableStateChanged() {
        super.drawableStateChanged();
        if (this.ˋ != null) {
            this.ˋ.ˋ();
        }
        if (this.ˎ != null) {
            this.ˎ.ˊ();
        }
    }

    public void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        if (this.ˎ != null) {
            this.ˎ.ˋ(context, i);
        }
    }

    public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(accessibilityEvent);
        accessibilityEvent.setClassName(Button.class.getName());
    }

    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName(Button.class.getName());
    }

    protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
        super.onLayout(z, i, i2, i3, i4);
        if (this.ˎ != null) {
            this.ˎ.ˏ(z, i, i2, i3, i4);
        }
    }

    public void setTextSize(int i, float f) {
        if (ॱ) {
            super.setTextSize(i, f);
        } else if (this.ˎ != null) {
            this.ˎ.ˊ(i, f);
        }
    }

    protected void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        super.onTextChanged(charSequence, i, i2, i3);
        if (this.ˎ != null && !ॱ && this.ˎ.ˎ()) {
            this.ˎ.ˏ();
        }
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public void setAutoSizeTextTypeWithDefaults(int i) {
        if (ॱ) {
            super.setAutoSizeTextTypeWithDefaults(i);
        } else if (this.ˎ != null) {
            this.ˎ.ˋ(i);
        }
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) throws IllegalArgumentException {
        if (ॱ) {
            super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
        } else if (this.ˎ != null) {
            this.ˎ.ॱ(i, i2, i3, i4);
        }
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] iArr, int i) throws IllegalArgumentException {
        if (ॱ) {
            super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
        } else if (this.ˎ != null) {
            this.ˎ.ˎ(iArr, i);
        }
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public int getAutoSizeTextType() {
        if (!ॱ) {
            return this.ˎ != null ? this.ˎ.ˋ() : 0;
        } else {
            if (super.getAutoSizeTextType() == 1) {
                return 1;
            }
            return 0;
        }
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public int getAutoSizeStepGranularity() {
        if (ॱ) {
            return super.getAutoSizeStepGranularity();
        }
        if (this.ˎ != null) {
            return this.ˎ.ॱ();
        }
        return -1;
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public int getAutoSizeMinTextSize() {
        if (ॱ) {
            return super.getAutoSizeMinTextSize();
        }
        if (this.ˎ != null) {
            return this.ˎ.ॱॱ();
        }
        return -1;
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public int getAutoSizeMaxTextSize() {
        if (ॱ) {
            return super.getAutoSizeMaxTextSize();
        }
        if (this.ˎ != null) {
            return this.ˎ.ᐝ();
        }
        return -1;
    }

    @RestrictTo({d.LIBRARY_GROUP})
    public int[] getAutoSizeTextAvailableSizes() {
        if (ॱ) {
            return super.getAutoSizeTextAvailableSizes();
        }
        if (this.ˎ != null) {
            return this.ˎ.ʻ();
        }
        return new int[0];
    }

    public void setSupportAllCaps(boolean z) {
        if (this.ˎ != null) {
            this.ˎ.ˊ(z);
        }
    }

    public void setCustomSelectionActionModeCallback(Callback callback) {
        super.setCustomSelectionActionModeCallback(TextViewCompat.ˏ(this, callback));
    }
}
